home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / componentEditorPanel.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  5.3 KB  |  195 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  19 Mar 1999
  22. //  Author:         jcs
  23. //
  24. //  Description:
  25. //      This script is a panel wrapper around the componentEditor script.  It
  26. //    handles creating the panel, unparented listers, saving of state, 
  27. //  initializing of preferences, etc.
  28. //
  29. //////////////////////////////////////////////////////////////////////
  30. //
  31. //  Procedure Name:
  32. //      createComponentEditorPanel
  33. //
  34. //  Description:
  35. //         Called once on panel creation. Leave initialization for 
  36. //        the init callback.  Do nothing here.
  37. //        
  38. //  Input Arguments:
  39. //      $whichPanel - name of the panel, but not used.
  40. //
  41. //  Return Value:
  42. //      None.
  43. //
  44.  
  45. if ( !`exists buildComponentEditorControls` ) {
  46.     source componentEditorWindow;
  47. }
  48.  
  49. global proc buildComponentEditorContextHelpItems(
  50.     string $nameRoot, string $menuParent)
  51. //
  52. //  Description:
  53. //        Build context sensitive menu items
  54. //        
  55. //  Input Arguments:
  56. //        $nameRoot - name to use as the root of all item names
  57. //        $menuParent - the name of the parent of this menu
  58. //
  59. //  Return Value:
  60. //      None
  61. //
  62. {
  63.     menuItem -label "Help on Component Editor..."
  64.         -enableCommandRepeat false
  65.         -command "showHelp ComponentEditor";
  66. }
  67.  
  68. global proc createComponentEditorPanel(string $whichPanel)
  69. {
  70.     //    Add support for the Context Sensitive Help Menu.
  71.     //
  72.     addContextHelpProc $whichPanel "buildComponentEditorContextHelpItems";
  73. }
  74.  
  75. //////////////////////////////////////////////////////////////////////
  76. //
  77. //  Procedure Name:
  78. //      initComponentEditorPanel
  79. //
  80. //  Description:
  81. //         Initialize editors to starting state.
  82. //        
  83. //  Input Arguments:
  84. //      $whichPanel - name of the panel, but not used.
  85. //
  86. //  Return Value:
  87. //      None.
  88. //
  89.  
  90. global proc initComponentEditorPanel(string $whichPanel)
  91. {}
  92.  
  93. //////////////////////////////////////////////////////////////////////
  94. //
  95. //  Procedure Name:
  96. //      addComponentEditorPanel
  97. //
  98. //  Description:
  99. //         create unparented editors requested by the prefs
  100. //        
  101. //  Input Arguments:
  102. //      $whichPanel - name of the panel, but not used.
  103. //
  104. //  Return Value:
  105. //      None.
  106. //
  107. global proc addComponentEditorPanel(string $whichPanel) 
  108. {
  109.     // the scripted panel control is a menuBarLayout; it contains a
  110.     // frame-layout child with the same name as the panel.
  111.     //
  112.     // Therefore: $panelControl is a menuBarLayout
  113.     //              $panelControl+"|"+$whichPanel is a frame layout
  114.  
  115.     buildComponentEditorControls ;
  116. }
  117.  
  118. //////////////////////////////////////////////////////////////////////
  119. //
  120. //  Procedure Name:
  121. //      removeComponentEditorPanel
  122. //
  123. //  Description:
  124. //      do whatever is necessary to clean up a given panel
  125. //        
  126. //  Input Arguments:
  127. //      $whichPanel - name of the panel to clean up.
  128. //
  129. //  Return Value:
  130. //      None.
  131. //
  132. global proc removeComponentEditorPanel(string $whichPanel)
  133. {}
  134.  
  135. //////////////////////////////////////////////////////////////////////
  136. //
  137. //  Procedure Name:
  138. //      saveComponentEditorPanel
  139. //
  140. //  Description:
  141. //      examine a given componentEditorPanel and return a MEL command
  142. //    which will recreate the panel in its current state.
  143. //        
  144. //  Input Arguments:
  145. //      $whichPanel - name of the panel to have its state examined.
  146. //
  147. //  Return Value:
  148. //      a command string that will create a componentEditor panel in the 
  149. //        same state as the input $whichPanel.
  150. //
  151. global proc string saveComponentEditorPanel(string $whichPanel)
  152. {
  153.     string $reCreateCmd = "";
  154.  
  155.     return $reCreateCmd;
  156. }
  157.  
  158. global proc string componentEditorPanel(string $panelName) {
  159. //
  160. //  Procedure Name:
  161. //      componentEditorPanel
  162. //
  163. //  Description:
  164. //        This proc defines the componentEditor panel type and 
  165. //        instantiates one.  Only one componentEditorPanel is allowed.
  166. //
  167. //  Input Arguments:
  168. //      $panelName the name of the panel to be created.
  169. //
  170. //  Return Value:
  171. //      None.
  172. //
  173.     global string $gMainPane;
  174.  
  175.     if (!`scriptedPanelType -exists componentEditorPanel`) {
  176.  
  177.         //  define the type of panel
  178.         //
  179.         scriptedPanelType
  180.             -createCallback "createComponentEditorPanel" 
  181.             -initCallback "initComponentEditorPanel"
  182.             -addCallback "addComponentEditorPanel"
  183.             -removeCallback "removeComponentEditorPanel" 
  184.             -saveStateCallback "saveComponentEditorPanel"
  185.             componentEditorPanel;
  186.  
  187.         //  create an instance of the test panel
  188.         //
  189.         setParent $gMainPane;
  190.         scriptedPanel -unParent -type "componentEditorPanel" $panelName;
  191.     }
  192.     
  193.     return $panelName;
  194. }
  195.